package com.zyk.scaffold.user.mail.sender;

import org.apache.commons.lang3.StringUtils;

public interface ILocalMailSender {
    boolean send(SenderMessage senderMessage);

    default boolean valid(SenderMessage senderMessage) {
        return !(senderMessage == null
                || null == senderMessage.getTo()
                || senderMessage.getTo().length == 0
                || StringUtils.isEmpty(senderMessage.getFrom())
                || StringUtils.isEmpty(senderMessage.getSubject()));
    }
}
